package lsdm.db;

import java.sql.*;

public class DbHandler {
    public static void main(String[] args) {
        oracleHandler();
    }

    public static void oracleHandler() {
        Connection connection = IOracle.getConnection("onedoc", "onedoc");
        try {
            PreparedStatement ps = connection.prepareStatement("select * from LOG");
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
                String id = rs.getString(1);
                System.out.println(id);
            }
            connection.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    public static void mysqlHandler() {
        Connection connection = IOracle.getConnection("root", "root");
        try {
            PreparedStatement ps = connection.prepareStatement("select * from user");
            ResultSet rs = ps.executeQuery();
            while (rs.next()) {
                String id = rs.getString(1);
                System.out.println(id);
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
